# -*- coding:utf-8 -*-

from com.mat.rpa.utils.globalConstants import GlobalConstants
from com.mat.rpa.views.workWindow.leftPanel.directiveTree import treeItem
from . import desktopElementConstants

class DesktopElementSubDirectiveTree(treeItem.TreeItemWithID):
    def __init__(self, parent):
        super(DesktopElementSubDirectiveTree, self).__init__(parent)
        self.createDesktopElementTreeNode()

    def createDesktopElementTreeNode(self):
        self.nodeType = GlobalConstants.treeBranchType
        self.directiveType = "desktopElementOperation"
        self.setText(0,"桌面元素操作")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, desktopElementConstants.DesktopElementConstants.draggingWinElementDirective, "拖拽元素(Win)")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, desktopElementConstants.DesktopElementConstants.waitingForWinElementDirective, "等待元素(Win)")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, desktopElementConstants.DesktopElementConstants.fillingInWinPasswordInputDirective,
                            "填写密码框(Win)")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, desktopElementConstants.DesktopElementConstants.settingWinComboboxDirective,
                            "设置下拉框(Win)")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, desktopElementConstants.DesktopElementConstants.settingWinCheckboxDirective,
                            "设置复选框(Win)")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, desktopElementConstants.DesktopElementConstants.settingValueOfWinElementDirective,
                            "设置元素值(Win)")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, desktopElementConstants.DesktopElementConstants.gettingWinElementObjectDirective,
                            "获取元素对象(Win)")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, desktopElementConstants.DesktopElementConstants.gettingWinRelatedElementDirective,
                            "获取关联元素(Win)")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, desktopElementConstants.DesktopElementConstants.gettingSimilarWinElementListDirective,
                            "获取相似元素列表(Win)")